package io;

import java.io.File;
import java.io.IOException;

public class Demo5 {
    public static void main(String[] args) throws IOException {
        File file = new File("./text1.txt");
        file.createNewFile();
        File file2 = new File("./testtext1.txt");
        file.renameTo(file2);//对文件进行改名
//        System.out.println(file.getName());

    }
}
